<%@ page import="entity.Rainquality" %>
<%@ page import="java.util.List" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2024/6/24
  Time: 上午 09:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    tr:nth-child(odd){
        background-color: #666666;
    }
</style>

<body>
<div align="center">
    <%
        List<Rainquality> list=(List<Rainquality>) application.getAttribute("list");
        if (list==null){
            response.sendRedirect(request.getContextPath()+"/pages/doindex.jsp?opr=getAll");
            return;
        }
    %>
    <h2>雨量检测信息</h2>
    <table cellspacing="0" cellpadding="0" border="1" align="center">
        <tr align="center">
            <td>序浩</td>
            <td>区域名称</td>
            <td>监测时间</td>
            <td>雨量值(mm)</td>
            <td>监测站</td>
            <td>站点地址</td>
        </tr>
        <%
            for (Rainquality rainquality:list){
        %>
        <tr align="center">
            <td><%=rainquality.getId()%></td>
            <td><%=rainquality.getDistrictName()%></td>
            <td><%=rainquality.getMonitorTime()%></td>
            <td><%=rainquality.getRain()%></td>
            <td><%=rainquality.getMonitoringStation()%></td>
            <td><%=rainquality.getMonitoringAddress()%></td>
        </tr>
        <%
            }
        %>
    </table>
</div>
<div style="position: absolute; left: 525px">


    <a href="<%=request.getContextPath()%>/pages/insert.jsp">新增雨量检测信息</a>


</div>
</body>
</html>
